﻿
using System;
using FlowCanvas.Nodes;
using ParadoxNotion.Design;
using Yoozoo.Gameplay.Liberty;

namespace Yoozoo.Gameplay.Liberty.Nodes
{
    [Category("Ggame")]
    public class EventRecord : CallableActionNode<string, bool>
    {
        public override void Invoke(string record, bool isGuide)
        {
            //判定参数有效性
            if (string.IsNullOrEmpty(record)) return;
            //去掉空格
            record = record.Trim();
            BlueprintUtils.SendRecordRequest(record);

            if (isGuide)
            {
                //判定参数有效性
                int num;
                if (Int32.TryParse(record, out num))
                {
                    BlueprintUtils.SendGuideRequest(num, 99);
                }
            }
        }
    }
}